package com.xiaobai.dynamics.config;
 
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
 
@Component
public class CustomEventListener {
 
    @EventListener
    public void onApplicationEvent(CustomEvent event) {
        System.out.println("Received custom event - " + event.getMessage());
    }

    @EventListener
    public void TestApplicationEvent(TestEvent event) {
        System.out.println("Received custom event - " + event.getMessage());
        System.out.println(event.getTest());
    }
}